﻿
CREATE FUNCTION [dbo].[UserGroups_TEXT]
()RETURNS varchar(max) AS BEGIN

DECLARE @Text varchar(8000)

SELECT @Text = ISNULL(@Text+',','')+GroupName FROM (SELECT TOP 100 PERCENT GroupName FROM UserGroups()U WHERE IsGroup = 1ORDER BY GroupName)U
RETURN @Text

END

